#coding:utf-8

from encSear import encSearBase
import re
import pycurl
__metaclass__=type #新式类

class md5com(encSearBase):
  def __init__(self):
    super(md5com,self).__init__(url='http://www.md5.com.cn/md5reverse',
                 patt=r'(?<=<b style="color\:red;">).*?(?=</b><br/><span style="font-family:)',
                 isP=True,
                 data='md=FUZZ&submit=MD5+Crack')      
    self.rq.setopt(pycurl.REFERER,'http://www.md5.com.cn/md5')
  
  def anlResponse(self):                       #解析返回的东西
    '''Analyze result html file'''
    #print self.ansResponse
    andPat=re.compile(self.webPattern,re.S)
    self.ans=andPat.search(self.ansResponse)
    ans=self.ans.group(0)
    if len(ans)>31 and ans[0:32]=='<span class="green res">NotFound':
      return "Not Found!"
    else:
      return ans
                 
             